<%@page import="java.text.SimpleDateFormat"%>
<%@page import="cn.edu.hust.sse.software7.class3.entities.EBUser"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<div style="background-color: activeborder; height: 610px;">
<%
if(null != session.getAttribute("message")){
%>
<div><%=session.getAttribute("message") %></div>
<%} %>
<%
	EBUser user = (EBUser) session.getAttribute("user");
	if (null != user) {
%>
<div
	style="font-style: oblique; font-weight: bolder; font-size: x-large; background-color: gray; height: 40px; text-decoration: underline; vertical-align: middle; left: 50px; padding-top: 10px; padding-left: 10px;">查看用户信息</div>
<div>
<form action="/user?method=update" method="post">

<table style="padding-left: 100px;">
	<tr>
		<td>用户名</td>
		<td><input type="text" name="userName" value="<%=user.getUserName() %>"/></td>
	</tr>
	<tr>
		<td>密码</td>
		<td><input type="password" " name="passwd" /></td>
	</tr>
	<tr>
		<td>新密码</td>
		<td><input type="password" " name="newpasswd" /></td>
	</tr>
	<tr>
		<td>重复密码</td>
		<td><input type="password" name="repasswd" /></td>
	</tr>
	<tr>
		<td>生日</td>
		<td><input type="text" name="birth" value="<%=new SimpleDateFormat("yyyy-MM-dd").format(user.getBirth()) %>"/></td>
	</tr>
	<tr>
		<td>手机</td>
		<td><input type="text" name="cellphone" value="<%=user.getCellPhone() %>"/></td>
	</tr>
	<tr>
		<td>Email</td>
		<td><input type="text" name="email" value="<%=user.getEmail() %>"/></td>
	</tr>
	<tr>
		<td><input type="reset" value="重置" /></td>
		<td><input type="submit" " value="修改" /></td>
	</tr>
</table>
</form>
</div>

<%
	} else {
%>
<div>There is no user to update. Please Login First!</div>
<%
	}
%></div>
</body>
</html>